<template>
  <div class="wrapper-header" style="display: flex">
    <div @click="goRouter('home')" style="width: 200px">
      <div class="align-center home-btn">
        <div>Home</div>
      </div>
    </div>
    <div class="top-menu-item" @click="goRouter('ComDemo')">组件Demo</div>
    <div class="top-menu-item" @click="goRouter('PageOuter')">页面组件调试</div>
    <div style="flex-grow: 1"></div>
  </div>
</template>

<script>
export default {
  name: 'HeaderBar',
  data() {
    return {
      userShow: false,
    };
  },
  computed: {
    curEmail() {
      return this.$store.state.developerObj.email;
    },
    firstChar() {
      return this.curEmail.charAt(0).toUpperCase();
    },
  },
  methods: {
    changeMenuHide() {
      this.$emit('change-menu-show');
      this.userShow = !this.userShow;
    },
    goRouter(name) {
      if (this.$router.history.current.name !== name) {
        const routerObj = { name };
        this.$router.push(routerObj);
      }
    },
  },
};
</script>

<style scoped>
.concat-btn {
  margin-right: 20px;
  font-size: 26px;
  color: #ffffff;
  cursor: pointer;
}
.concat-btn:hover {
  color: #dddddd;
}

.wrapper-header {
  width: 100%;
  height: 64px;
  line-height: 64px;

  top: 0;
  right: 0;
  z-index: 10;

  background-image: linear-gradient(143deg, #1d42ab, #2173dc, #1e93ff);
  background-color: #2b83f9;
  padding-right: 20px;
}

.top-logo-item-2 {
  width: 200px;
  height: 64px;
  cursor: pointer;
}

.top-menu-item {
  color: rgba(255, 255, 255, 0.75);
  padding: 0 16px;
  font-size: 14px;
  cursor: pointer;
}

.top-menu-item:hover {
  background-color: #5bb6fd;
  color: #ffffff;
}

.username-font {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
}

.align-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-btn {
  font-size: 18px;
  color: #ffffff;
  cursor: pointer;
}
.home-btn:hover {
  color: #2b83f9;
}
</style>
